#ifndef __STRUCTURES_H
#define __STRUCTURES_H

#include <vector>

using namespace std;

/**
 * General game settings
 */
struct game_settings
{
	int field_radius;
	int move_interval;
	int fsp;
	int nsp;
	int my_num;     // Set to 1 if bot plays as the first player and 2 otherwise
	int enemy_num;  // 1 if opponent plays as first player and 2 otherwise
	int max_health; // Calculated as max health of all unit types
};

/**
 * Unit type characteristics
 */
struct unit_type
{
	int max_health;
	int shot_damage;
	int move_radius;
	int shot_radius;
};

/**
 * State is a group of units located in the same cell of the board
 */
struct state
{
	int x;
	int y;
	int player_num;
	int unit_type_id;
	int unit_count;
	int last_unit_health;
	int since_last_move;
};

/**
 * Move information
 */
struct move
{
	int unit_count;
	int step_count;
	int from_x;
	int from_y;
	int to_x;
	int to_y;
	int attack_x;
	int attack_y;
	double effect; // Higher value is better
	move();
	move(int unit_count, int from_x, int from_y, int to_x, int to_y, int attack_x, int attack_y);
};

/**
 * Unit group to be located on the board in the beginning of the game
 */
struct available
{
	int unit_type_id;
	int unit_count;
};

/**
 * Zone for locating units in the beginning of the game
 */
struct zone
{
	int x;
	int y;
	int player_num; // 0 means blocked zone
};

/**
 * Unit group location (used in the beginning of the game)
 */
struct location
{
	int x;
	int y;
	int unit_type_id;
	int unit_count;
};

/**
 * 2D point
 */
struct point
{
	int x;
	int y;
	point();
	point(int x, int y);
};

/**
 * Game field
 */
typedef vector<vector<state>> game_field;

#endif